var OrderDetail = function () {
  var template = /* html */ `
    <div class="order-detail">
      <div class="order-detail-btns">
        <el-button size="small" type="primary" @click="print">打印</el-button>
      </div>
      <div class="print-area" style="text-align:center">
        <div class="order-detail-content">
          <img :src="formatImgUrl(imgUrl)">
        </div>
      </div>
    </div>
  `;

  return {
    props: {
      order: {
        type: Object,
        required: true
      }
    },

    data: function () {
      var url = this.order.url;
      return {
        imgUrl: url
      };
    },

    methods: {
      print: function () {
        var $print = $(this.$el).find('.print-area');
        $print = $print.clone();
        $print.css('display', 'none');
        $('#app').append($print);
        window.print();
        $print.remove();
      }
    },

    template: template
  };
}();